package service

import (
	"context"

	stage "stage/hertz_gen/stage"
	. "stageRpc/client"
	stageRpcModel "stageRpc/kitex_gen/stage"

	"github.com/cloudwego/hertz/pkg/app"
	"github.com/jinzhu/copier"
)

type EidtZoomService struct {
	RequestContext *app.RequestContext
	Context        context.Context
}

func NewEidtZoomService(Context context.Context, RequestContext *app.RequestContext) *EidtZoomService {
	return &EidtZoomService{RequestContext: RequestContext, Context: Context}
}

func (h *EidtZoomService) Run(req *stage.Zoom) (resp *bool, err error) {
	var zoom = new(stageRpcModel.Zoom)
	err = copier.Copy(zoom, req)
	if err != nil {
		return nil, err
	}
	r, err := StageClient.EidtZoom(context.Background(), zoom)
	if err != nil {
		return nil, err
	}
	resp = &r
	return
}
